home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Leser 19
/
Amiga Plus Leser CD 19.iso
/
Online
/
AmigaTalk
/
intuition
/
GadgetActivation.st
< prev
next >
Wrap
Text File
|
2002-03-15
|
2KB
|
64 lines
" -------------------------------------------------------------------- "
" GadgetActivation Class is a Singleton class that allows the user to "
" reference Gadget Activation flags without having to remember their "
" actual hexadecimal values. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getGadgetActivation: #GACT_RELVERIFY' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" -------------------------------------------------------------------- "
Class GadgetActivation :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ (self privateSetup)
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self at: #GACT_STRINGLEFT put: 0.
self at: #GACT_RELVERIFY put: 1.
self at: #GACT_IMMEDIATE put: 2.
self at: #GACT_ENDGADGET put: 4.
self at: #GACT_FOLLOWMOUSE put: 8.
self at: #GACT_RIGHTBORDER put: 16r10.
self at: #GACT_LEFTBORDER put: 16r20.
self at: #GACT_TOPBORDER put: 16r40.
self at: #GACT_BOTTOMBORDER put: 16r80.
self at: #GACT_TOGGLESELECT put: 16r100.
self at: #GACT_STRINGCENTER put: 16r200.
self at: #GACT_STRINGRIGHT put: 16r400.
self at: #GACT_LONGINT put: 16r800.
self at: #GACT_ALTKEYMAP put: 16r1000.
self at: #GACT_BOOLEXTEND put: 16r2000.
self at: #GACT_STRINGEXTEND put: 16r2000.
self at: #GACT_ACTIVEGADGET put: 16r4000.
"Neither set nor rely on this bit:"
self at: #GACT_BORDERSNIFF put: 16r8000.
].
^ self "uniqueInstance??"
]